package com.Khan.SocialRescueSys.service.impl;

import com.Khan.SocialRescueSys.dao.CommentDao;
import com.Khan.SocialRescueSys.dao.ForceDao;
import com.Khan.SocialRescueSys.pojo.Comment;
import com.Khan.SocialRescueSys.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author Khan Liu
 * @date 2022/4/5 15:03
 */
@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentDao commentDao;

    @Override
    public List<Comment> getCommentByForceId(Long forceId) {
        return commentDao.getCommentByForceId(forceId);
    }

    @Override
    public int saveComment(Comment comment) {
        comment.setCreateTime(new Date());
        return commentDao.saveComment(comment);
    }
}
